/**
 * 
 */
package com.xbang.attendance.entity.system;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

import com.xbang.core.config.Note;

import enumeration.RegionType;
import enumeration.WarningType;

/**
 * 地区
 * 
 * @author dev.zhang
 */
@Entity
public class Region implements Serializable {

	private static final long serialVersionUID = -2967835242753081808L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;

	/** 地区编号 */
	@Note(value = "地区编号")
	private String number;

	/** 地区名称 */
	@Note(value = "地区名称")
	private String name;

	/** 父级地区 */
	@ManyToOne(fetch = FetchType.EAGER, cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REMOVE })
	private Region parent;

	private String description;

	/**地区类型*/
	@Enumerated(EnumType.STRING)
	private RegionType regionType;
	
	/**
	 * The default constructor
	 */
	public Region() {

	}

	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the parent
	 */
	public Region getParent() {
		return parent;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @param parent
	 *            the parent to set
	 */
	public void setParent(Region parent) {
		this.parent = parent;
	}

	/**
	 * @return the number
	 */
	public String getNumber() {
		return number;
	}

	/**
	 * @param number
	 *            the number to set
	 */
	public void setNumber(String number) {
		this.number = number;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description
	 *            the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	public RegionType getRegionType() {
		return regionType;
	}

	public void setRegionType(RegionType regionType) {
		this.regionType = regionType;
	}

}
